package nci60.data.maxquant

/**
 * Representing the single cell lines (experiments)
 * <p />
 * The name of the sql table is customized to 'experiments' <p />
 * <b>See Also:</b> {@link #mapping}
 * 
 * @autor <a href="mailto:Florian.J.Auer@googlemail.com">Florian J. Auer</a>
*/
class Experiment {

    /**
     * Id attribute for the table. Is also used as primary key. <p />
     * This property is normaly generated and accessable for every domain class! 
     */
    Integer id
    
    /**
    * name of the cell line (experiment)
    */
    String name
    
    /**
    * p-number used in the MaxQuant analysis, and therefore in the output files
    */
    String pNumber
    
    /**
    * grouping of the cell line
    * @see nci60.data.maxquant.ExperimentClass
    */
    ExperimentClass currentClass
    
    /**
    * reference to the analysis it belongs to
    * <b>See Also:</b> {@link nci60.data.maxquant.Project} <p />
    * The property has the customized column name "project_id" <p />
    * <b>See Also:</b> {@link #mapping}
    */
    Project currentProject
    
    /**
    * indicates, if the cell line is excluded from any analysis
    */
    boolean excluded = false

    
    /**
     * GRAILS <a href="http://grails.org/doc/latest/guide/GORM.html#ormdsl" target="_blank">Custom ORM Mapping</a>
     * <p />
     * Grails domain classes can be mapped onto many legacy schemas with an Object Relational Mapping DSL (domain specific language). 
     */	
    static mapping = {
        table 'experiments'
        currentProject column:'project_id'
        version false
        autoTimestamp false
    }

    /**
     * GRAILS <a href="http://grails.org/doc/latest/guide/single.html#constraints" target="_blank">Declaring Constraints</a>
     * <p />
     * Constraints in Grails are a way to declaratively specify validation rules for generating objects in GORM.
     */	
    static constraints = {
    }

    /**
     * GRAILS default representation of the object as String
     * @return String representation of the object
     */	
    String toString() {
        return "Experiment:$name; Project:"+currentProject.name+";"
    }
}
